<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!doctype html>
<html lang="en"><head>
    <meta charset="utf-8">
    <title>主页</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
	<%@ include file="../commons/taglibs.jsp"%>
  <script type="text/javascript">
    function loadUrl(url,columnRight){
      var iframeObj = document.getElementById("mainContent");
      iframeObj.src = url;
    }
    
       function SetWinHeight(obj){ 
		   		setTimeout(function(obj){
		   		var ifm= document.getElementById("mainContent");
      			var subWeb = document.frames ? document.frames["mainContent"].document :ifm.contentDocument;
                if(ifm != null && subWeb != null) {
           			 $("#mainContent").css('height',subWeb.body.scrollHeight)
           	   }
		   		},1500); 
		   
		
		} 
  </script>

<style type="text/css"> 
#navsite { 
    font-family: Verdana, Helvetica, Arial, sans-serif; 
    font-size: 0.7em; 
    font-weight: bold; 
    width: 12em; 
    border-right: 1px solid #666; 
    padding: 0; 
    margin-bottom: 1em; 
    background-color: #026A87; 
    color: #333; 
} 
#navsite ul { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
} 
#navsite ul li { 
    margin: 0; 
    border-top: 1px solid #003; 
} 
#navsite ul li a { 
    display: block; 
 	 padding: 2px 2px 2px 0.5em; 
    border-left: 10px solid #369; 
    border-right: 1px solid #69c; 
    border-bottom: 1px solid #369; 
    background-color: #036; 
    color: #fff; 
    text-decoration: none; 
    width: 100%; 
} 
html>body #navsite ul li a { 
    width: auto; 
} 
#navsite ul li a:hover { 
    border-left: 10px solid #036; 
    border-right: 1px solid #69c; 
    border-bottom: 1px solid #369; 
    background-color: #69f; 
    color: #fff; 
} 
</style>

<script type="text/javascript">
			
		// 加载系统的子菜单
		function loadPlatform(tag){
			alert(tag)
			var url='<%=path %>/tuser/loadMenu.do'	
			 $.ajax({
				url:url,
				data:{tag:tag},
				type:'post',
				dataType:'JSON',
				error : function(e){
					$.messager.alert('提示','拉取菜单失败！','error')
				},
				success:function(result){
					fillMenu(result)
				}
			})
		
		}


	
	//根据数据返回的结果 填充左侧菜单
	function fillMenu(result){
		var status=result.status;
		if(status=='-1'){
			$.messager.alert('提示','您不具有该系统的使用权限！')
		}else{
			var data=result.list;
				$("#aa").html("");
				$("#aa").append("<div id='bb'></div>")
				var content=''
			for(var i in data){
				if(data[i].modelName==''||data[i].modelName==null)continue;
				if(i==0){
				
		
					//content="<ul id='"+data[i].modelCode+"'></ul>"
				
					$("#bb").append(" <div title='"+data[i].modelName+"' data-options='selected:true' style='overflow:auto;padding:20px;'><ul id='"+data[i].modelCode+"'></ul></div>  ");
				}else{
					// content="<ul id='"+data[i].modelCode+"'></ul>"
					$("#bb").append(" <div title='"+data[i].modelName+"'  style='overflow:auto;padding:20px;'><ul id='"+data[i].modelCode+"'></ul></div>  ");
				}
				var childLst=data[i].childLst;
				for(var j in childLst){
				
					if(childLst[j].modelName==''||childLst[j].modelName==null)continue;
					if(childLst[j].colum1Right=='1'){
						loadUrl(childLst[j].modelUrl,childLst[j].columRight);
						$("#"+data[i].modelCode).append(
							"<a id='btn"+childLst[j].modelCode+"' data-options='plain:true,iconCls:\""+childLst[j].icons+"\",selected:true' style='width:98%;margin-bottom:5px;' onclick='loadUrl(\""+childLst[j].modelUrl+"\",\""+childLst[j].columRight+"\")'>"+childLst[j].modelName+"</a>"
						)
					}else{
						$("#"+data[i].modelCode).append(
							"<a id='btn"+childLst[j].modelCode+"'  data-options='plain:true,iconCls:\""+childLst[j].icons+"\"'style='width:98%;margin-bottom:5px;' onclick='loadUrl(\""+childLst[j].modelUrl+"\",\""+childLst[j].columRight+"\")'>"+childLst[j].modelName+"</a>")
					}
						
					$('#btn'+childLst[j].modelCode).linkbutton({   
					});
					
			$('#btn'+childLst[j].modelCode).on('click', function(){    
					$("a[id^='btn']").linkbutton({selected:false}); 
			                $(this).linkbutton({selected:true});  
			}); 
			
					}	
				}
			 
			 
			 		$('#bb').accordion( {
					});
			 


			}			
	
	}
		

		
		//注销登陆
		function loginOut(){
				 window.location.href="<%=path %>";
		}
		
		//修改密码
		function resetPass(){
			var url="<%=path %>/jsp/password.jsp";	
			$('#updatePassword').dialog('refresh', url);
  			$('#updatePassword').dialog('open'); 
		}
		
		
		//初始化绑定点击a标签的事件  头部菜单的事件
		$(function(){
			
		//	loadPlatform('ans')
		
			$("#myTag li a").click(function(){
				$("#myTag li a").attr("class","");
				$(this).attr("class","this")
			});
		
		})
		
		
</script>


</head>
 
	<body id="cc" class="easyui-layout" data-options="fit:true">
		<input type="hidden" id="panHight" />
	<div data-options="region:'north',border:false"
			style="height: 92px;padding:5px;margin:0; text-align:right; background:#026A87;">
			
		<div  id="logo" style="height:80px;width:100%;background:#026A87;padding:0;margin:0; border:0; " >
		
				<span style="float: left;text-align: center;height: 80px;width: 80%">
					<span style="margin-top: 15px;width: 40%;float: left" ><font style="background:#e1e5e8;font-family: 'Georgia', Tahoma, Sans-Serif;font-size: 40px;line-height: 50px;color: #888;" >
						旅游车综合管理系统
					</font></span>
					<img style="height:80px; width: 300px;float: left;margin: 5"  src="<%=path %>/img/_021.png"/>
					<img style="height:80px; width: 300px;float: left;margin: 5"  src="<%=path %>/img/_021.png"/>
					<img style="height:80px; width: 300px;float: left;margin: 5"  src="<%=path %>/img/_021.png"/>
<%-- 					<img style="height:80px; width: 280px;float: left;margin: 5"  src="<%=path %>/img/bg2.jpg"/> --%>
<%-- 					<img style="height:80px; width: 280px;float: left;margin: 5"  src="<%=path %>/img/bg3.jpg"/> --%>
				</span>	
				<span style="width: 300px;margin: 0;">
					<div style="float:right; padding-top:10px;">
					<ul>
					<li>		    <a href="#" class="easyui-linkbutton t1" plain="true" icon="icon_group_blue_new" onClick="resetPass()"><font color="#FFFFFF">修改密码</font></a>
					</li>
					<li>		    <a href="#" onClick="if(!confirm('你确定退出吗？')){return false;}else{loginOut()}" class="easyui-linkbutton t1" plain="true" icon="icon-undo" ><font color="#FFFFFF">退出系统</font></a>
					
					</li>
					</ul>
				    <br/> 
				</div>
			</span>
		</div>
		
			
		
    	
    </div>	
			<!-- 左侧菜单栏 -->
		<div id="navsite" data-options="region:'west',title:'菜单',split:true"
			style="width: 185px;">
			<div id="aa"   class="easyui-accordion"  >  
				<div title='基础信息' data-options='selected:true' style='overflow:auto;padding:20px;'>
					<ul>
						  <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_application_osx_add'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/busEmploee/index.jsp')">司机管理</a>
						  <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_application_osx_add'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/busInfo/index.jsp')">车辆管理</a>
						  <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_application_osx_add'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/busOrder/index.jsp')">订单管理</a>
						   <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_error_do_not'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/feeIncome/index.jsp')">收费管理</a>
						 <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_folder_modernist_opened'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/feeCost/index.jsp')">花费管理</a>					</ul>
				</div> 
				
				
				<div title='统计分析' data-options='selected:true' style='overflow:auto;padding:20px;'>
					<ul>
				    	  <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_application_osx_edit'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/total/cost_total.jsp')">订单花费统计</a>
				    	  <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_folder_modernist_opened'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/total/list_bus.jsp')">车辆花费统计</a>
						  <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_contact_grey_add'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/total/list_order.jsp')">订单费用汇总</a>
				    	  <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_folder_modernist_add'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/total/bus_olic.jsp')">平均油耗</a>
				    	  <a id="btn" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon_music_cd_blue_note'" style="width:98%;margin-bottom:5px;" onclick="loadUrl('<%=path %>/jsp/oa/OaProduct/list.jsp')">物品管理</a>
					</ul>
				</div> 
				
			    </div>
			    
			   
		</div>		
	
			
		<div id="content" 	data-options="region:'center',title:'欢迎您!${sessionScope.name}'"
			style="padding: 5px;">
			<center>
			<input type="hidden" name="orgId" id="orgId" value="${sessionScoep.orgId }" />
			<input type="hidden"  name="postLev" id="postLev" value="${sessionScoep.postLev }"  />
				<iframe id="mainContent" frameborder="0"
					style="background: #fff; text-align: center;" onload="Javascript:SetWinHeight(this)" 
					src="<%=path %>/jsp/busOrder/index.jsp"
       						 frameborder=no width="100%" scrolling="yes" 
					>
				</iframe>
			</center>
		</div>	
		
		     <div  id="updatePassword"  class="easyui-dialog" data-options="title: '修改密码',   
					    width: 330,
					    height: 180,  
					    top:160, 
					    closed: true,   
					    cache: false,   
					    modal: true  "></div>	
					    
			<script type="text/javascript">
			$('.easyui-linkbutton').on('click', function(){    
				$('.easyui-linkbutton').linkbutton({selected:false}); 
			    $(this).linkbutton({selected:true});  
			});   
						
		
   		setTimeout(function(obj){	
			var c = $('#cc');
			var p = c.layout('panel','center');	// get the center panel
			var oldHeight = p.panel('panel').outerHeight();
			$("#mainContent").css('height',oldHeight);
			
			$("#panHight").val(oldHeight-38);			
			},2000)			
			</script>		    
		
</body>

</html>

